﻿@using DeliveryPlus.Web.Classes.Ext
@model System.Collections.Generic.List<DeliveryPlus.Web.DAL.Entities.Article>

@{
    ViewBag.Title = "Раздел \"О доставке\"";
    Layout = "../Shared/ControlPanelLayout.cshtml";
}

@if (Model.Count == 0)
{ 
    <p>
        <a class="btn btn-info" href="/ControlPanel/ManageAboutDelivery/Add">Добавить информацию о доставке</a>
    </p>
}
<table class="table table-bordered table-hover">
    <thead>
        <tr>
            <th>ИД</th>
            <th>Просмотров</th>
            <th style="width: 150px"></th>
        </tr>
    </thead>
    <tbody>
        @if (Model.Count == 0)
        {
            <tr>
                <td colspan="5">Раздел "О доставке" не заполнен</td>
            </tr>
        }
        else
        {
            foreach (var article in Model)
            {
                <tr>
                    <td>@article.Id</td>
                    <td>@article.Views</td>
                    <td>
                        <a href="/ControlPanel/ManageAboutDelivery/Edit/@article.Id">Редактировать</a>
                        <a href="/ControlPanel/ManageAboutDelivery/Delete/@article.Id" onclick="return confirm('Действительно хотите удалить?')">Удалить</a>
                    </td>
                </tr>
            }
        }
    </tbody>
</table>